﻿using Dal;
using MD5Hash;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Month;

namespace WebApplicatirgrg.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        public ValuesController(EroolDAL bll)
        {
            Bll = bll;
        }

        public EroolDAL Bll { get; }
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="e">实体</param>
        /// <returns>返回添加成功或失败</returns>
        [HttpPost("EroolAdd")]
        public int EroolAdd(EroolTableInfor e)
        {
            try
            {
                
                return Bll.EroolAdd(e);
            }
            catch (Exception)
            {

                throw;
            }



        }

        /// <summary>
        /// 登录功能
        /// </summary>
        /// <param name="LName">名称</param>
        /// <param name="LPassword">密码</param>
        /// <returns>返回成功或密码登录失败，账号登录失败</returns>
        [HttpPost("loginSel")]
        public LoginTableInfor loginSel(string LName, string LPassword)
        {
            try
            {

                return Bll.loginSel(LName, LPassword);
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
